/** 表格表头 */
export const tableColumns = (t: (m:string) => string) => [
  {
    prop: 'id',
    type: 'selection',
    label: t('table.selection'),
    width: 55,
  },
  {
    prop: 'id',
    label: t('table.id'),
    minWidth: 100,
  },
  {
    prop: 'sort',
    label: t('table.sort'),
    minWidth: 100,
  },
  {
    prop: 'content',
    label: t('table.content'),
    minWidth: 120,
  },
  {
    prop: 'daan',
    label: t('table.answer'),
    minWidth: 120,
    format: (value: string[]) => {
      if(value) {
        return value.join('、')
      }
      return value
    },
  },
  {
    prop: 'huodong_name',
    label: t('table.activityName'),
    minWidth: 120,
  },
  // {
  //   prop: '',
  //   label: '类型',
  //   minWidth: 120,
  // },
  {
    prop: 'status',
    label: t('table.status'),
    minWidth: 100,
  },
  {
    prop: 'addtime',
    label: t('table.addtime'),
    minWidth: 180,
    format: 'date|YYYY-MM-DD HH:mm:ss',
  },
  {
    prop: 'action',
    label: t('table.operation'),
    width: 140,
    fixed: 'right',
  },
];

/** 表格搜索表单 */
export const tableSearchFormItems = (t: (m:string) => string) => [
  {
    attrs: {
      label: t("search.content"),
      prop: 'content',
    },
    value: '',
    component: {
      is: 'el-input',
      props: {
        placeholder: t("search.content.placeholder"),
      },
    },
  },
];
